<?php

require_once 'Zend/View/Helper/Abstract.php';

class Core_View_Helper_Controls_RadioXmlDeclaration extends Zend_View_Helper_Abstract
{
    /**
     * @param   string  $name
     * @param   string  $value
     * @param   array   $attribs
     * @return  string  HTML radio input element
     */
    public function radioXmlDeclaration($name, $value, $attribs = null, $options = null, $listSep = "\n")
    {
        $options = array(
            'always'  => $this->view->getTranslation('Always'),
            'never'   => $this->view->getTranslation('Never'),
            'browser' => $this->view->getTranslation('By browser check'),
        );
        $form = new Core_Form();
        $radio = $form->createElement('radio', $name, array(
            'multiOptions'  => $options,
            'value'         => $value,
            'listSep'       => $listSep,
        ));
        if (is_array($attribs)) {
            $radio->setAttribs($attribs);
        }
        return $radio;
    }
}